package com.ibiaoke.common.base;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

/**
 * Created by huhaichao on 2017/6/8.
 */
@Getter
@Setter
public class Page {

    private int pageNo = 1;
    private int pageSize = 10;

    private long totalCount = 0;
    private int totalPage = 1;


    public long getTotalPage() {
        return totalCount % pageSize == 0 ? totalCount / pageSize : totalCount / pageSize + 1;
    }

    public int limitStart() {
        return pageSize * (pageNo - 1);
    }

    public int limitEnd() {
        return pageSize;
    }

}
